|
|
Thorsten Froehlich wrote:
>> And for RTTI: I cannot imagine that a dynamic_cast has real little
>> overhead but I honestly hope that it is the case until I run a test
>> in the next days.
>
> Effectively you only need it when using multiple inheritance. Of course,
> if you depend on dynamic_cast heavily, you probably have some serious
> problem understanding C++.
>
I wouldn't say that. It depends on the problem.
Of course, virtualisation should be preferred where possible.
Virtual function calls are cheap and fast (the ovherhead compared to
normal external calls is negliable unless it's a just-return-value
function in some inner loop).
>> Okay, my observations quoted above were based on my experiences on the
>> gcc-2.7.3.2 -> gcc-2.8 transition and may very well be outdated.
>
> One of the slowest known compilers around ... and outdated by half a
> decade.
>
True. I just did not re-examine my observations from the past, so I am
doing that now.
>> So, RTTI and exceptions still introduce considerable overhead even if
>> not used.
>
> Shitty compiler => shitty code! You should really use professional
> compilers to base your comparisons on. Gcc's main feature is portability,
> not performance.
>
Heeee. gcc is by all means no "shitty compiler". But we may try using
e.g. the intel compiler (it has -fno-rtti but no -fno-exceptions).
Do you know how RTTI internally works? (I.e. in an "non-shitty"
compiler.)
Wolfgang
Post a reply to this message
|
|